package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.FacilitiesFileDao;
import cn.topevery.garden.entity.po.FacilitiesFile;
import cn.topevery.garden.entity.query.FacilitiesFileQuery;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 
 *
 * @author code-generate
 * @date 2021-08-06
 */
@Service
public class FacilitiesFileLogic extends BaseLogic<FacilitiesFile> {
    @Autowired
    FacilitiesFileDao facilitiesFileDao;

    @Override
    public BaseEntityDao<FacilitiesFile, Integer> getDao() {
        return facilitiesFileDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<FacilitiesFile> listPage(FacilitiesFileQuery query) {
        return facilitiesFileDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        facilitiesFileDao.delete(userId, ids);
    }

    public void saveOrUpdate(String userId, FacilitiesFile file) {
        facilitiesFileDao.saveOrUpdate(userId, file);
    };

    public void delByMainId(String userId, Integer mainId) { facilitiesFileDao.delByMainId(userId, mainId);}

    public List<FacilitiesFile> getByMainId(Integer mainId) { return facilitiesFileDao.getByMainId(mainId);}
}
